package top.superflow.service.view.config

import org.springframework.web.bind.annotation.{RequestMapping, ResponseBody, RestController}
import top.superflow.flow.config.FlowConfig
import top.superflow.flow.config.process.ProcessConfig
import top.superflow.log.Loggable
import top.superflow.service.view.BaseViewService
import top.superflow.service.view.dto.ColumnDef

@RestController
@RequestMapping(Array("/view/config"))
class GridViewService extends BaseViewService with Loggable{


  @RequestMapping(Array("/flow"))
  @ResponseBody
  def getFlowColumns: List[ColumnDef] = {
    extractColumns(classOf[FlowConfig])
  }


  @RequestMapping(Array("/process"))
  @ResponseBody
  def getProcessColumns: List[ColumnDef] = {
    extractColumns(classOf[ProcessConfig])
  }



  @RequestMapping(Array("/resource"))
  @ResponseBody
  def getResourceColumns: List[ColumnDef] = {
    extractColumns(classOf[ProcessConfig])
  }

}
